package actions.complaints;

import java.util.List;

import actions.base.BaseAction;

import data.Staff;

public class Assign extends BaseAction {

	List<Staff> technicians;

	int id;
	
	int idComplaint;

	@Override
	public String execute() throws Exception {
		technicians = services.getTechnicians();
		if (id > 0) {
			services.assignTechnicians(idComplaint, id);
			return redirect("Listing.action");
		}
		return SUCCESS;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the idComplaint
	 */
	public int getIdComplaint() {
		return idComplaint;
	}

	/**
	 * @param idComplaint the idComplaint to set
	 */
	public void setIdComplaint(int idComplaint) {
		this.idComplaint = idComplaint;
	}

	/**
	 * @return the technicians
	 */
	public List<Staff> getTechnicians() {
		return technicians;
	}

	/**
	 * @param technicians
	 *            the technicians to set
	 */
	public void setTechnicians(List<Staff> technicians) {
		this.technicians = technicians;
	}

}
